package com.buddy.sds.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.buddy.sds.auth.entity.SystemDictItem;
import com.buddy.sds.auth.mapper.ISystemDictItemMapper;
import com.buddy.sds.auth.service.ISystemDictItemService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemDictItemImpl extends ServiceImpl<ISystemDictItemMapper, SystemDictItem> implements ISystemDictItemService {

    @Override
    public boolean existsKey(String key) {

        return baseMapper.existsByKey(key);
    }

    @Override
    public List<SystemDictItem> listByDict(String dictId) {

        return baseMapper.selectList(new QueryWrapper<SystemDictItem>().eq("item_dict",dictId));
    }

    @Override
    public SystemDictItem getByIdentAndKey(String dictIdent, String itemKey) {
        return baseMapper.getByIdentAndKey(dictIdent,itemKey);
    }

    @Override
    public List<SystemDictItem> listByDictIent(String dictIdent) {
        return baseMapper.getByDictIdent(dictIdent);
    }
}
